<%@ page language="java" import="englishChicken.*,java.util.Iterator,java.util.List,java.util.Calendar,java.util.Date;"%>
<%@ page errorPage="error.jsp?source=cambiarPass.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
 String usuario=(String)session.getAttribute("login_user");
 AlmacenDeUsuarios adu=AlmacenDeUsuarios.getInstance();
 Usuario uAct=adu.getUsuario(usuario);

 String accion=request.getParameter("accion");
 if(accion!=null){
	 if(accion.equals("cambiar")){
	 	String p=request.getParameter("passw");
	 	uAct.setPassMd5(p);
	 	adu.modifyUsuario(uAct);
	 }
 }
 %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>English Chicken</title>
<link type='text/css' href='css/cambiarPass.css' rel='stylesheet' media='all'>
<script type="text/javascript" src="js/cambiarPass.js"></script>
<script type="text/javascript" src="js/md5.js"></script>
<script type="text/javascript" src="js/ajax.js"></script>
</head>
<body>
<table id="tablaPass">
	<tr>
		<td>Contrase&ntilde;a actual:</td>
		<td><input type="password" name="passAct" id="passAct"></td>
	</tr>
	<tr>
		<td>Nueva Contrase&ntilde;a:</td>
		<td><input type="password" name="passN1" id="passN1"></td>
	</tr>
	<tr>
		<td>Repita Nueva Contrase&ntilde;a:</td>
		<td> <input type="password" name="passN2" id="passN2"></td>
	</tr>

	<tr>
		<td colspan="2"><input type="button" value="Guardar Cambios" onclick="enviar('<%=usuario%>')">
		<input type="button" value="Restablecer" onclick="restablecer()"></td>
	</tr>
</table>	

</body>
</html>